package com.ihai.spring.boot.sample.controller;

import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * DESC
 *
 * @author 张驰
 * @date 2020/8/20
 */
@RestController
public class TestController {
    @RequestMapping("/xml")
    public String xml(@RequestBody String arg){
        System.out.println(arg);
        return "<person><s1><s2><s3><name>primeton</name></s3></s2></s1><age>100</age></person>";
    }
    @RequestMapping("/json")
    public String json(@RequestBody String arg){
        System.out.println(arg);
        return "{\"person\":{\"name\":\"primeton\",\"age\":\"100\"}}";
    }
}
